package com.atguigu.builder.improve;

/**
 * 指挥者 这里指定制作流程
 *
 * @author gcq
 * @Create 2020-10-03
 */
public class HouseDirector {
    HouseBuilder houseBuilder = null;

    // 构造器传入

    public HouseDirector(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }
    // set传入
    public void setHouseBuilder(HouseBuilder builder) {
        this.houseBuilder = builder;
    }

    // 如何处理建造房子的流程，交给指挥者
    public House constructHouse() {
        houseBuilder.buildBasic();
        houseBuilder.buildWalls();
        houseBuilder.roofed();
        return houseBuilder.buildHouse();
    }

}